import React, { Fragment } from 'react'
import { connect } from 'react-redux'
import Header from '../../components/Header'

const Home = (props) => {
    const { home: { name } } = props

    return (
        <Fragment>
            <Header />
            <div>This is Home page. My name is {name} <button onClick={() => {alert('hello world');}}>click me</button></div>
        </Fragment>
    )
}

const mapStateToProps = state => ({
    home: state.home
})

export default connect(mapStateToProps, null)(Home)
